import httpclient.JSON;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.NameValuePair;
import javax.json.bind.Jsonb;
import javax.json.bind.JsonbBuilder;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;


@WebServlet(urlPatterns = {"/login/dgut"})
public class Recall extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String token = request.getParameter("token");
        List<NameValuePair> formparams = new ArrayList();

        formparams.add(new BasicNameValuePair("token",token));

        String str = JSON.post("https://cas.dgut.edu.cn/oauth/getUserInfo",formparams);
        Jsonb jsonb = JsonbBuilder.create();


    }
    protected void doPost(HttpServletRequest request,
                          HttpServletResponse response) throws IOException {

        doGet(request,response);
    }
}